import com.sun.jna.Native;
import com.sun.jna.win32.StdCallLibrary;

public class MacitcsiNew {

    public interface CLibrary extends StdCallLibrary {
        interface FileReceivedCallbackCallback extends StdCallCallback  {
            int fileReceived(int siteId, String fileName);
        }

        interface GetTmpFileNameCallback extends StdCallCallback  {
            int getTmpFileName(int deviceId, String filename, int nameLength);
        }


        void SetFileReceived(MacitcsiNew.CLibrary.FileReceivedCallbackCallback fileReceivedCallbackCallback);

        void SetGetTmpFileName(MacitcsiNew.CLibrary.GetTmpFileNameCallback getTmpFileNameCallback);

        void InitializeCsiLibrary();


        void CreateCsiSerialInstance(int deviceId,int type,int aaa);

        boolean CreateCSIInstance(int deviceId, boolean bSquelchLogging);
        
    }
    
    
    
    public static void main(String[] args) {
        MacitcsiNew.CLibrary lib = (MacitcsiNew.CLibrary) Native.loadLibrary("C:\\workspace\\angel-bo\\angel-business\\src\\test\\java\\macitcsi.dll", MacitcsiNew.CLibrary.class);


        CLibrary.FileReceivedCallbackCallback fileReceivedCallbackCallback = new CLibrary.FileReceivedCallbackCallback() {
            @Override
            public int fileReceived(int siteId, String fileName) {
                System.out.println("fileReceived");
                return 0;
            }
        };

        CLibrary.GetTmpFileNameCallback getTmpFileNameCallback = new CLibrary.GetTmpFileNameCallback() {
            @Override
            public int getTmpFileName(int deviceId, String filename, int nameLength) {
                System.out.println("getTmpFileName");
                return 0;
            }
        };


        lib.SetFileReceived(fileReceivedCallbackCallback);
        lib.SetGetTmpFileName(getTmpFileNameCallback);

        lib.InitializeCsiLibrary();



        try{
            lib.CreateCsiSerialInstance(6,3,57600);
            Thread.sleep(1000);
        }catch (Exception e){
            e.printStackTrace();
        }


    }
}
